class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.u: F = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: C = None
        self.y: E = None
        self.p: H = None
        self.t: G = None
        self.o: E = None
        self.v: F = None
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: J = None
        self.s: J = None
        self.w: I = None
        self.u: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: I = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.o: H = None
        self.u: F = None
        self.t: A = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: C = None
        self.y: E = None
        self.p: H = None
        self.t: G = None
        self.o: E = None
        self.v: F = None
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: J = None
        self.s: J = None
        self.w: I = None
        self.u: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: I = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.o: H = None
        self.u: F = None
        self.t: A = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: F = None
        self.txt = txt

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

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

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