class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: H = None
        self.v: G = None
        self.y: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: D = None
        self.y: G = None
        self.x: A = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: D = None
        self.y: G = None
        self.x: A = None
        self.o: G = None
        self.txt = txt

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

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

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