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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: D = None
        self.q: C = None
        self.p: G = None
        self.z: G = None
        self.v: E = None
        self.w: G = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: H = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: H = None
        self.o: F = None
        self.q: B = None
        self.t: G = None
        self.y: F = None
        self.v: G = None
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: A = None
        self.x: A = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: D = None
        self.q: C = None
        self.p: G = None
        self.z: G = None
        self.v: E = None
        self.w: G = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: H = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: H = None
        self.o: F = None
        self.q: B = None
        self.t: G = None
        self.y: F = None
        self.v: G = None
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: A = None
        self.x: A = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

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

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