class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.r: C = None
        self.v: D = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: J = None
        self.y: I = None
        self.r: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: E = None
        self.o: C = None
        self.z: F = None
        self.v: C = None
        self.u: G = None
        self.t: F = None
        self.p: A = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: J = None
        self.y: I = None
        self.r: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: E = None
        self.o: C = None
        self.z: F = None
        self.v: C = None
        self.u: G = None
        self.t: F = None
        self.p: A = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

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

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

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