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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: G = None
        self.x: C = None
        self.o: G = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.t: A = None
        self.p: D = None
        self.txt = txt

d = A("d")
h = B("h")
k = C("k")
n = D("n")
j = E("j")
l = F("l")
e = G("e")
f = H("f")
i = D("i")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: G = None
        self.x: C = None
        self.o: G = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.t: A = None
        self.p: D = None
        self.txt = txt

d = A("d")
h = B("h")
k = C("k")
n = D("n")
j = E("j")
l = F("l")
e = G("e")
f = H("f")
i = D("i")
m = H("m")

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