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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: A = None
        self.q: B = None
        self.w: J = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: I = None
        self.t: H = None
        self.o: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: A = None
        self.q: B = None
        self.w: J = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: I = None
        self.t: H = None
        self.o: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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