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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: F = None
        self.q: B = None
        self.w: D = None
        self.u: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: H = None
        self.o: J = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: F = None
        self.q: B = None
        self.w: D = None
        self.u: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: H = None
        self.o: J = None
        self.txt = txt

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

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

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