class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: C = None
        self.p: D = None
        self.v: D = None
        self.u: E = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: B = None
        self.t: E = None
        self.q: B = None
        self.y: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: B = None
        self.t: E = None
        self.q: B = None
        self.y: E = None
        self.v: E = None
        self.txt = txt

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

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