class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: B = None
        self.t: C = None
        self.r: D = None
        self.w: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: H = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: H = None
        self.t: H = None
        self.x: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: H = None
        self.x: F = None
        self.z: G = None
        self.txt = txt

k = A("k")
n = B("n")
c = C("c")
d = D("d")
l = E("l")
j = F("j")
b = G("b")
g = H("g")
f = I("f")

k.o = l
k.s = n
k.t = c
k.r = d
k.w = d
k.v = j
n.o = j
n.p = g
n.u = d
n.w = c
c.o = f
c.r = d
c.w = n
d.y = c
d.z = b
d.u = f
l.u = c
l.y = n
l.o = d
l.w = f
l.s = k
j.w = c
j.y = c
j.q = f
j.x = f
j.o = k
j.z = k
j.p = n
j.v = l
b.p = l
b.r = g
b.t = g
b.x = n
g.p = j
f.o = d
f.y = g
f.x = j
f.z = b
assert c.r.u.y.p.q.z.t.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: B = None
        self.t: C = None
        self.r: D = None
        self.w: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: H = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: H = None
        self.t: H = None
        self.x: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: H = None
        self.x: F = None
        self.z: G = None
        self.txt = txt

k = A("k")
n = B("n")
c = C("c")
d = D("d")
l = E("l")
j = F("j")
b = G("b")
g = H("g")
f = I("f")

k.o = l
k.s = n
k.t = c
k.r = d
k.w = d
k.v = j
n.o = j
n.p = g
n.u = d
n.w = c
c.o = f
c.r = d
c.w = n
d.y = c
d.z = b
d.u = f
l.u = c
l.y = n
l.o = d
l.w = f
l.s = k
j.w = c
j.y = c
j.q = f
j.x = f
j.o = k
j.z = k
j.p = n
j.v = l
b.p = l
b.r = g
b.t = g
b.x = n
g.p = j
f.o = d
f.y = g
f.x = j
f.z = b
assert c.r.u.y.p.q.z.t.p.p.txt == "n"