class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: F = None
        self.s: A = None
        self.y: I = None
        self.u: J = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: F = None
        self.r: H = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: I = None
        self.x: F = None
        self.w: B = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: E = None
        self.y: A = None
        self.z: J = None
        self.o: J = None
        self.w: G = None
        self.x: E = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: D = None
        self.w: A = None
        self.y: G = None
        self.x: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: H = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: F = None
        self.s: A = None
        self.y: I = None
        self.u: J = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: F = None
        self.r: H = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: I = None
        self.x: F = None
        self.w: B = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: E = None
        self.y: A = None
        self.z: J = None
        self.o: J = None
        self.w: G = None
        self.x: E = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: D = None
        self.w: A = None
        self.y: G = None
        self.x: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: H = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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