class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: G = None
        self.z: F = None
        self.y: E = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: A = None
        self.p: F = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.v: C = None
        self.o: A = None
        self.w: F = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

m = A("m")
l = B("l")
h = C("h")
n = D("n")
k = E("k")
c = F("c")
j = G("j")
e = C("e")
a = F("a")

m.r = j
m.p = j
m.z = c
m.y = k
m.q = k
l.p = n
l.q = k
l.y = a
h.u = l
h.s = m
h.p = a
h.x = j
n.o = j
k.z = e
k.t = c
k.v = l
c.s = e
c.x = n
c.z = l
j.y = n
j.s = h
j.v = e
j.o = m
j.z = m
j.w = a
j.u = l
e.u = l
e.s = m
e.p = c
e.x = j
a.s = e
a.x = n
a.z = l
assert k.v.y.x.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: G = None
        self.z: F = None
        self.y: E = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: A = None
        self.p: F = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.v: C = None
        self.o: A = None
        self.w: F = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

m = A("m")
l = B("l")
h = C("h")
n = D("n")
k = E("k")
c = F("c")
j = G("j")
e = C("e")
a = F("a")

m.r = j
m.p = j
m.z = c
m.y = k
m.q = k
l.p = n
l.q = k
l.y = a
h.u = l
h.s = m
h.p = a
h.x = j
n.o = j
k.z = e
k.t = c
k.v = l
c.s = e
c.x = n
c.z = l
j.y = n
j.s = h
j.v = e
j.o = m
j.z = m
j.w = a
j.u = l
e.u = l
e.s = m
e.p = c
e.x = j
a.s = e
a.x = n
a.z = l
assert k.v.y.x.o.z.txt == "m"