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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: A = None
        self.s: G = None
        self.v: A = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: G = None
        self.v: B = None
        self.t: D = None
        self.w: H = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.p: G = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.s: G = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: A = None
        self.s: G = None
        self.v: A = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: G = None
        self.v: B = None
        self.t: D = None
        self.w: H = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.p: G = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.s: G = None
        self.u: B = None
        self.txt = txt

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

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