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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: J = None
        self.p: J = None
        self.t: D = None
        self.o: D = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: J = None
        self.o: G = None
        self.v: B = None
        self.s: G = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: B = None
        self.s: C = None
        self.v: J = None
        self.y: H = None
        self.w: C = None
        self.p: F = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: C = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: J = None
        self.p: J = None
        self.t: D = None
        self.o: D = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: J = None
        self.o: G = None
        self.v: B = None
        self.s: G = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: B = None
        self.s: C = None
        self.v: J = None
        self.y: H = None
        self.w: C = None
        self.p: F = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: C = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

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