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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.y: B = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.v: B = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
f = D("f")
m = E("m")
n = F("n")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: C = None
        self.y: B = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.v: B = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
f = D("f")
m = E("m")
n = F("n")

b.t = m
b.v = m
b.q = n
b.s = k
b.p = k
b.x = i
i.z = m
i.o = f
k.w = b
k.q = m
k.x = m
k.s = m
k.v = m
f.r = b
f.p = k
f.z = k
f.y = i
f.v = n
m.o = n
m.p = i
n.x = i
n.v = i
n.q = f
assert k.w.x.z.o.v.txt == "i"