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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: E = None
        self.z: D = None
        self.o: I = None
        self.y: A = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: F = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: C = None
        self.z: I = None
        self.y: J = None
        self.s: J = None
        self.t: H = None
        self.v: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: H = None
        self.z: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: A = None
        self.o: A = None
        self.z: I = None
        self.s: A = None
        self.w: I = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: E = None
        self.z: D = None
        self.o: I = None
        self.y: A = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: F = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: C = None
        self.z: I = None
        self.y: J = None
        self.s: J = None
        self.t: H = None
        self.v: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: H = None
        self.z: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: A = None
        self.o: A = None
        self.z: I = None
        self.s: A = None
        self.w: I = None
        self.t: D = None
        self.txt = txt

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

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