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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.r: D = None
        self.u: A = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: E = None
        self.z: F = None
        self.v: A = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.t: E = None
        self.u: E = None
        self.txt = txt

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

j = A("j")
c = B("c")
i = C("i")
n = D("n")
d = E("d")
m = F("m")
f = E("f")
e = B("e")
a = D("a")

j.u = f
c.s = j
c.u = j
c.p = e
c.q = e
c.r = a
c.w = i
i.u = j
i.v = j
i.w = d
i.z = m
i.r = c
n.s = j
d.v = m
d.y = m
d.t = f
d.u = f
m.z = d
f.v = m
f.y = m
f.t = d
f.u = d
e.s = j
e.u = j
e.p = c
e.q = c
e.r = a
e.w = i
a.s = j
assert j.u.v.z.y.z.v.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.r: D = None
        self.u: A = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: E = None
        self.z: F = None
        self.v: A = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.t: E = None
        self.u: E = None
        self.txt = txt

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

j = A("j")
c = B("c")
i = C("i")
n = D("n")
d = E("d")
m = F("m")
f = E("f")
e = B("e")
a = D("a")

j.u = f
c.s = j
c.u = j
c.p = e
c.q = e
c.r = a
c.w = i
i.u = j
i.v = j
i.w = d
i.z = m
i.r = c
n.s = j
d.v = m
d.y = m
d.t = f
d.u = f
m.z = d
f.v = m
f.y = m
f.t = d
f.u = d
e.s = j
e.u = j
e.p = c
e.q = c
e.r = a
e.w = i
a.s = j
assert j.u.v.z.y.z.v.z.t.txt == "f"