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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.r: E = None
        self.x: F = None
        self.u: D = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: G = None
        self.s: C = None
        self.o: H = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.r: G = None
        self.s: E = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.r: E = None
        self.x: F = None
        self.u: D = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: G = None
        self.s: C = None
        self.o: H = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.r: G = None
        self.s: E = None
        self.z: D = None
        self.txt = txt

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

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