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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: E = None
        self.w: D = None
        self.q: D = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

l.s = e
l.u = n
l.z = g
g.o = n
g.x = n
g.u = n
g.p = n
g.w = e
g.q = e
j.r = g
j.w = e
e.o = g
h.r = n
f.s = n
f.p = e
f.o = g
b.p = j
c.z = b
c.x = b
a.s = n
a.p = e
a.o = g
n.r = h
assert a.s.r.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: E = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: E = None
        self.w: D = None
        self.q: D = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

l.s = e
l.u = n
l.z = g
g.o = n
g.x = n
g.u = n
g.p = n
g.w = e
g.q = e
j.r = g
j.w = e
e.o = g
h.r = n
f.s = n
f.p = e
f.o = g
b.p = j
c.z = b
c.x = b
a.s = n
a.p = e
a.o = g
n.r = h
assert a.s.r.r.r.r.r.txt == "h"