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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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