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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: A = None
        self.q: E = None
        self.r: J = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.p: J = None
        self.w: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: A = None
        self.q: E = None
        self.r: J = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.p: J = None
        self.w: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

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