class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: E = None
        self.o: I = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: I = None
        self.u: E = None
        self.p: A = None
        self.r: D = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.x: I = None
        self.s: C = None
        self.p: I = None
        self.z: F = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: C = None
        self.z: I = None
        self.q: E = None
        self.t: E = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: I = None
        self.u: E = None
        self.p: A = None
        self.r: D = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.x: I = None
        self.s: C = None
        self.p: I = None
        self.z: F = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: C = None
        self.z: I = None
        self.q: E = None
        self.t: E = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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