class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: D = None
        self.q: B = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: A = None
        self.s: E = None
        self.u: A = None
        self.o: E = None
        self.x: C = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: A = None
        self.w: B = None
        self.txt = txt

n = A("n")
m = B("m")
e = C("e")
h = D("h")
i = E("i")
c = F("c")
d = G("d")
l = B("l")

n.o = m
n.u = h
n.q = l
n.z = c
m.v = e
e.r = n
e.t = i
h.o = l
h.y = m
i.v = c
c.q = h
c.y = h
c.p = n
c.u = n
c.s = i
c.o = i
c.x = e
d.p = i
d.s = n
d.w = l
l.v = e
assert c.u.o.v.t.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: D = None
        self.q: B = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: A = None
        self.s: E = None
        self.u: A = None
        self.o: E = None
        self.x: C = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: A = None
        self.w: B = None
        self.txt = txt

n = A("n")
m = B("m")
e = C("e")
h = D("h")
i = E("i")
c = F("c")
d = G("d")
l = B("l")

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