class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.o: G = None
        self.p: G = None
        self.u: J = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: J = None
        self.p: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: G = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: F = None
        self.z: F = None
        self.w: D = None
        self.txt = txt

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

a = A("a")
j = B("j")
i = C("i")
l = D("l")
k = E("k")
e = F("e")
n = G("n")
b = H("b")
d = I("d")
h = J("h")

a.q = d
j.x = k
j.y = e
j.o = n
j.p = n
j.u = h
j.w = b
i.r = n
i.p = e
l.x = b
l.v = h
l.p = k
l.z = a
k.r = b
k.o = n
k.x = d
e.q = h
e.o = l
n.u = h
b.o = n
d.t = e
d.x = e
d.z = e
d.w = l
h.p = n
assert i.r.u.p.u.p.u.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.o: G = None
        self.p: G = None
        self.u: J = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: J = None
        self.p: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: G = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: F = None
        self.z: F = None
        self.w: D = None
        self.txt = txt

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

a = A("a")
j = B("j")
i = C("i")
l = D("l")
k = E("k")
e = F("e")
n = G("n")
b = H("b")
d = I("d")
h = J("h")

a.q = d
j.x = k
j.y = e
j.o = n
j.p = n
j.u = h
j.w = b
i.r = n
i.p = e
l.x = b
l.v = h
l.p = k
l.z = a
k.r = b
k.o = n
k.x = d
e.q = h
e.o = l
n.u = h
b.o = n
d.t = e
d.x = e
d.z = e
d.w = l
h.p = n
assert i.r.u.p.u.p.u.p.u.p.txt == "n"