class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.u: A = None
        self.x: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: I = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: G = None
        self.x: D = None
        self.r: I = None
        self.y: F = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: G = None
        self.q: C = None
        self.z: C = None
        self.x: B = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: I = None
        self.t: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.u: I = None
        self.t: G = None
        self.o: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.u: A = None
        self.x: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: I = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: G = None
        self.x: D = None
        self.r: I = None
        self.y: F = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: G = None
        self.q: C = None
        self.z: C = None
        self.x: B = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: I = None
        self.t: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.u: I = None
        self.t: G = None
        self.o: D = None
        self.txt = txt

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

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

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