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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.v: B = None
        self.q: D = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.s: C = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.v: B = None
        self.q: D = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.s: C = None
        self.q: E = None
        self.txt = txt

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

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