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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: F = None
        self.x: C = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: D = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

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

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

j.t = n
j.x = n
j.w = h
j.z = m
j.p = f
j.r = f
c.v = m
c.y = i
c.o = i
c.t = f
c.x = d
n.z = j
i.t = f
i.o = f
i.x = n
i.y = n
i.p = m
m.q = i
m.t = i
m.z = k
m.v = f
f.u = m
f.t = m
f.q = d
d.u = m
d.t = m
d.q = f
h.v = m
h.y = i
h.o = i
h.t = d
h.x = d
k.t = n
k.x = n
k.w = h
k.z = m
k.p = f
k.r = d
assert m.z.p.u.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: B = None
        self.z: E = None
        self.p: F = None
        self.x: C = None
        self.r: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: F = None
        self.x: C = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: D = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

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

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

j.t = n
j.x = n
j.w = h
j.z = m
j.p = f
j.r = f
c.v = m
c.y = i
c.o = i
c.t = f
c.x = d
n.z = j
i.t = f
i.o = f
i.x = n
i.y = n
i.p = m
m.q = i
m.t = i
m.z = k
m.v = f
f.u = m
f.t = m
f.q = d
d.u = m
d.t = m
d.q = f
h.v = m
h.y = i
h.o = i
h.t = d
h.x = d
k.t = n
k.x = n
k.w = h
k.z = m
k.p = f
k.r = d
assert m.z.p.u.z.p.txt == "f"