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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: E = None
        self.w: B = None
        self.o: A = None
        self.x: G = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: E = None
        self.w: B = None
        self.o: A = None
        self.x: G = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

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

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