class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: G = None
        self.x: F = None
        self.z: D = None
        self.w: B = None
        self.p: B = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.txt = txt

c = A("c")
l = B("l")
g = C("g")
f = D("f")
m = E("m")
e = F("e")
n = G("n")
k = H("k")
b = G("b")
h = D("h")

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: D = None
        self.txt = txt

c = A("c")
l = B("l")
g = C("g")
f = D("f")
m = E("m")
e = F("e")
n = G("n")
k = H("k")
b = G("b")
h = D("h")

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