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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.y: F = None
        self.s: J = None
        self.x: H = None
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: J = None
        self.v: G = None
        self.x: J = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: C = None
        self.p: B = None
        self.z: E = None
        self.q: F = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: I = None
        self.q: B = None
        self.y: C = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.y: F = None
        self.s: J = None
        self.x: H = None
        self.p: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: J = None
        self.v: G = None
        self.x: J = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: C = None
        self.p: B = None
        self.z: E = None
        self.q: F = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: I = None
        self.q: B = None
        self.y: C = None
        self.o: B = None
        self.txt = txt

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

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