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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: G = None
        self.y: F = None
        self.o: C = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: D = None
        self.u: A = None
        self.y: H = None
        self.s: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: C = None
        self.q: H = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: C = None
        self.r: D = None
        self.x: D = None
        self.u: A = None
        self.q: B = None
        self.s: A = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: G = None
        self.p: B = None
        self.r: I = None
        self.u: I = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: G = None
        self.y: F = None
        self.o: C = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: D = None
        self.u: A = None
        self.y: H = None
        self.s: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: C = None
        self.q: H = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: C = None
        self.r: D = None
        self.x: D = None
        self.u: A = None
        self.q: B = None
        self.s: A = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: G = None
        self.p: B = None
        self.r: I = None
        self.u: I = None
        self.txt = txt

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

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

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

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