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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

m = A("m")
k = B("k")
e = C("e")
a = D("a")
h = E("h")
b = F("b")
d = A("d")
i = E("i")

m.z = b
m.p = d
m.r = a
m.t = a
m.u = h
m.q = k
k.v = b
k.t = m
e.o = k
e.t = i
e.q = b
e.v = a
a.p = e
a.s = e
a.t = m
a.y = b
h.p = i
b.y = k
d.z = b
d.p = m
d.r = a
d.t = a
d.u = i
d.q = k
i.p = h
assert a.y.y.v.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: A = None
        self.r: D = None
        self.u: E = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

m = A("m")
k = B("k")
e = C("e")
a = D("a")
h = E("h")
b = F("b")
d = A("d")
i = E("i")

m.z = b
m.p = d
m.r = a
m.t = a
m.u = h
m.q = k
k.v = b
k.t = m
e.o = k
e.t = i
e.q = b
e.v = a
a.p = e
a.s = e
a.t = m
a.y = b
h.p = i
b.y = k
d.z = b
d.p = m
d.r = a
d.t = a
d.u = i
d.q = k
i.p = h
assert a.y.y.v.y.v.y.txt == "k"