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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: H = None
        self.z: B = None
        self.t: B = None
        self.y: H = None
        self.o: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.v: B = None
        self.u: C = None
        self.y: A = None
        self.s: A = None
        self.p: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.x: G = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

d = A("d")
a = B("a")
n = C("n")
m = D("m")
k = E("k")
c = F("c")
b = G("b")
g = H("g")
l = B("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: H = None
        self.z: B = None
        self.t: B = None
        self.y: H = None
        self.o: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.v: B = None
        self.u: C = None
        self.y: A = None
        self.s: A = None
        self.p: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.x: G = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

d = A("d")
a = B("a")
n = C("n")
m = D("m")
k = E("k")
c = F("c")
b = G("b")
g = H("g")
l = B("l")

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