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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: A = None
        self.s: C = None
        self.p: A = None
        self.t: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: A = None
        self.s: C = None
        self.p: A = None
        self.t: F = None
        self.txt = txt

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

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

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

h.w = g
h.z = b
h.t = m
h.p = m
h.v = e
h.s = e
b.q = h
m.q = h
m.v = h
g.u = m
g.s = m
g.r = h
g.p = h
g.t = k
n.x = h
n.q = m
n.w = l
l.z = h
l.s = e
e.u = m
e.s = m
e.r = h
e.p = h
e.t = k
f.z = h
f.s = g
k.z = h
k.s = g
assert n.q.q.z.q.txt == "h"