#! /usr/bin/env python

import os
import sys
import subprocess as sub

if __name__ == "__main__":
    job_id = sys.argv[1]
    cmd = "scontrol show jobid=%s | grep StdOut"%(job_id)
    #lines = sub.check_output(cmd, shell=True).decode().split()[0][7:-(10+len(job_id))]
    lines = "/" + "/".join(sub.check_output(cmd, shell=True).decode().split("/")[1:-1]) + "/"
    print (lines)
