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

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

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

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

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

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

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

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

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

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

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

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

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

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

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