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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.t: E = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.q: B = None
        self.t: D = None
        self.u: F = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.p: D = None
        self.u: D = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

a = A("a")
m = B("m")
b = C("b")
n = D("n")
j = E("j")
g = F("g")
c = B("c")
d = B("d")

a.z = j
a.x = b
a.t = g
m.o = j
m.t = g
b.v = n
n.x = a
n.o = b
n.t = j
n.u = c
j.z = b
j.r = d
j.q = d
j.t = n
j.p = n
j.u = g
g.w = c
g.r = n
g.p = n
g.u = n
g.z = a
g.o = a
c.o = j
c.t = g
d.o = j
d.t = g
assert g.p.t.t.t.z.v.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: C = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.t: E = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.q: B = None
        self.t: D = None
        self.u: F = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.p: D = None
        self.u: D = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

a = A("a")
m = B("m")
b = C("b")
n = D("n")
j = E("j")
g = F("g")
c = B("c")
d = B("d")

a.z = j
a.x = b
a.t = g
m.o = j
m.t = g
b.v = n
n.x = a
n.o = b
n.t = j
n.u = c
j.z = b
j.r = d
j.q = d
j.t = n
j.p = n
j.u = g
g.w = c
g.r = n
g.p = n
g.u = n
g.z = a
g.o = a
c.o = j
c.t = g
d.o = j
d.t = g
assert g.p.t.t.t.z.v.t.p.txt == "n"