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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: I = None
        self.t: G = None
        self.q: F = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: D = None
        self.w: H = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: I = None
        self.y: H = None
        self.z: D = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: B = None
        self.q: J = None
        self.y: F = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: J = None
        self.x: A = None
        self.txt = txt

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

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

i.o = b
i.t = k
i.s = k
i.q = j
i.x = a
i.y = g
i.z = n
i.r = f
n.r = f
h.x = g
h.s = g
h.r = f
h.t = j
h.q = k
g.p = n
b.t = a
b.y = g
b.r = g
b.w = e
k.y = e
j.o = h
j.t = h
j.s = f
j.y = e
j.z = g
j.p = i
e.t = i
e.x = n
e.q = a
e.y = k
e.o = f
f.y = e
f.o = a
f.x = i
a.x = j
assert n.r.o.x.z.p.r.o.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.q: G = None
        self.x: J = None
        self.y: D = None
        self.z: B = None
        self.s: F = None
        self.r: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: I = None
        self.t: G = None
        self.q: F = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: D = None
        self.w: H = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: I = None
        self.y: H = None
        self.z: D = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: B = None
        self.q: J = None
        self.y: F = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: J = None
        self.x: A = None
        self.txt = txt

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

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

i.o = b
i.t = k
i.s = k
i.q = j
i.x = a
i.y = g
i.z = n
i.r = f
n.r = f
h.x = g
h.s = g
h.r = f
h.t = j
h.q = k
g.p = n
b.t = a
b.y = g
b.r = g
b.w = e
k.y = e
j.o = h
j.t = h
j.s = f
j.y = e
j.z = g
j.p = i
e.t = i
e.x = n
e.q = a
e.y = k
e.o = f
f.y = e
f.o = a
f.x = i
a.x = j
assert n.r.o.x.z.p.r.o.x.p.txt == "i"