class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: F = None
        self.q: B = None
        self.z: D = None
        self.o: G = None
        self.p: J = None
        self.w: G = 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.s: E = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: H = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

e.t = g
e.u = i
e.q = l
e.z = k
e.o = m
e.w = m
e.p = c
l.p = n
g.s = j
g.t = i
k.x = g
k.o = n
k.r = n
j.u = i
j.y = i
j.p = g
j.r = f
j.t = k
j.o = c
j.w = n
i.q = g
i.u = e
m.x = g
m.w = j
n.u = f
n.w = k
n.p = l
n.x = l
n.v = c
n.y = c
n.z = m
n.o = j
n.t = j
f.y = j
f.r = k
c.p = i
assert g.s.p.s.p.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: F = None
        self.q: B = None
        self.z: D = None
        self.o: G = None
        self.p: J = None
        self.w: G = 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.s: E = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: H = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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