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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.u: F = None
        self.x: C = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
e = C("e")
h = D("h")
n = E("n")
b = F("b")
i = C("i")

j.q = e
j.w = m
j.v = m
j.y = h
j.x = h
j.z = b
m.o = h
m.q = i
m.u = b
m.x = e
m.z = n
m.y = n
e.x = b
e.t = i
h.w = n
h.o = n
h.v = b
n.y = h
n.z = e
b.w = m
b.p = e
i.x = b
i.t = e
assert i.t.x.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: B = None
        self.y: D = None
        self.v: B = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.u: F = None
        self.x: C = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: E = None
        self.v: F = None
        self.txt = txt

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

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

j = A("j")
m = B("m")
e = C("e")
h = D("h")
n = E("n")
b = F("b")
i = C("i")

j.q = e
j.w = m
j.v = m
j.y = h
j.x = h
j.z = b
m.o = h
m.q = i
m.u = b
m.x = e
m.z = n
m.y = n
e.x = b
e.t = i
h.w = n
h.o = n
h.v = b
n.y = h
n.z = e
b.w = m
b.p = e
i.x = b
i.t = e
assert i.t.x.w.x.txt == "e"