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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: H = None
        self.y: G = None
        self.q: J = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: H = None
        self.v: G = None
        self.w: A = None
        self.p: I = None
        self.s: A = None
        self.q: G = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: H = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: H = None
        self.y: G = None
        self.q: J = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: H = None
        self.v: G = None
        self.w: A = None
        self.p: I = None
        self.s: A = None
        self.q: G = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: H = None
        self.u: D = None
        self.txt = txt

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

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

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