class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: H = None
        self.u: C = None
        self.q: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: H = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: H = None
        self.v: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: H = None
        self.v: A = None
        self.q: A = None
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: H = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: H = None
        self.v: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: H = None
        self.v: A = None
        self.q: A = None
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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