class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: C = None
        self.t: B = None
        self.y: D = None
        self.txt = txt

i = A("i")
l = B("l")
h = C("h")
g = D("g")
f = D("f")
d = C("d")
n = B("n")
k = A("k")

i.z = k
l.v = h
h.z = d
h.v = d
g.w = i
g.s = d
g.t = n
g.y = f
f.w = i
f.s = h
f.t = n
f.y = g
d.z = h
d.v = h
n.v = h
k.z = i
assert g.y.t.v.v.v.v.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: C = None
        self.t: B = None
        self.y: D = None
        self.txt = txt

i = A("i")
l = B("l")
h = C("h")
g = D("g")
f = D("f")
d = C("d")
n = B("n")
k = A("k")

i.z = k
l.v = h
h.z = d
h.v = d
g.w = i
g.s = d
g.t = n
g.y = f
f.w = i
f.s = h
f.t = n
f.y = g
d.z = h
d.v = h
n.v = h
k.z = i
assert g.y.t.v.v.v.v.v.z.txt == "d"