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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: C = None
        self.s: C = None
        self.r: E = None
        self.txt = txt

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

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

b = A("b")
f = B("f")
e = C("e")
k = D("k")
h = E("h")
i = F("i")

b.t = f
b.z = e
b.o = e
b.s = e
b.q = i
b.x = i
f.v = h
f.s = e
f.r = k
f.t = b
f.x = b
f.y = b
e.z = h
e.v = f
k.p = b
k.x = e
k.s = e
k.r = h
h.r = k
h.z = b
i.q = h
i.t = b
assert i.t.t.t.o.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.q: F = None
        self.x: F = None
        self.o: C = None
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: C = None
        self.s: C = None
        self.r: E = None
        self.txt = txt

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

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

b = A("b")
f = B("f")
e = C("e")
k = D("k")
h = E("h")
i = F("i")

b.t = f
b.z = e
b.o = e
b.s = e
b.q = i
b.x = i
f.v = h
f.s = e
f.r = k
f.t = b
f.x = b
f.y = b
e.z = h
e.v = f
k.p = b
k.x = e
k.s = e
k.r = h
h.r = k
h.z = b
i.q = h
i.t = b
assert i.t.t.t.o.z.z.txt == "b"