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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: I = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: H = None
        self.q: B = None
        self.z: B = None
        self.u: E = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

n = A("n")
h = B("h")
e = C("e")
k = D("k")
d = E("d")
a = F("a")
m = G("m")
g = H("g")
f = I("f")
j = J("j")

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: I = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: H = None
        self.q: B = None
        self.z: B = None
        self.u: E = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

n = A("n")
h = B("h")
e = C("e")
k = D("k")
d = E("d")
a = F("a")
m = G("m")
g = H("g")
f = I("f")
j = J("j")

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