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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: H = None
        self.p: E = None
        self.w: H = None
        self.t: H = None
        self.s: E = None
        self.q: F = None
        self.z: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: G = None
        self.r: B = None
        self.s: G = None
        self.q: A = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: B = None
        self.q: J = None
        self.w: G = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: H = None
        self.q: C = None
        self.u: A = None
        self.s: A = None
        self.x: D = None
        self.r: I = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: B = None
        self.w: G = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: H = None
        self.p: E = None
        self.w: H = None
        self.t: H = None
        self.s: E = None
        self.q: F = None
        self.z: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: G = None
        self.r: B = None
        self.s: G = None
        self.q: A = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: B = None
        self.q: J = None
        self.w: G = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: H = None
        self.q: C = None
        self.u: A = None
        self.s: A = None
        self.x: D = None
        self.r: I = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: B = None
        self.w: G = None
        self.v: G = None
        self.txt = txt

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

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

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

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