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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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

a.p = b
a.z = b
a.o = i
a.t = c
b.s = m
b.q = h
m.x = k
m.p = k
m.z = k
m.s = i
m.o = a
m.u = b
k.w = c
k.x = c
k.q = m
k.y = b
k.s = a
c.r = k
c.z = b
c.o = h
i.t = m
i.z = b
i.x = b
i.s = c
i.y = h
h.r = k
h.z = b
h.o = c
assert i.x.s.o.t.o.o.o.txt == "h"