class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.u: G = None
        self.q: F = None
        self.v: H = None
        self.x: H = None
        self.w: G = None
        self.o: F = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: H = None
        self.r: E = None
        self.y: C = None
        self.s: C = None
        self.o: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: B = None
        self.s: E = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: H = None
        self.p: I = None
        self.w: D = None
        self.s: C = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.u: G = None
        self.q: F = None
        self.v: H = None
        self.x: H = None
        self.w: G = None
        self.o: F = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: H = None
        self.r: E = None
        self.y: C = None
        self.s: C = None
        self.o: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: B = None
        self.s: E = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: H = None
        self.p: I = None
        self.w: D = None
        self.s: C = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

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