class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: G = None
        self.w: F = None
        self.o: F = None
        self.s: I = None
        self.y: J = None
        self.t: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: J = None
        self.w: D = None
        self.s: A = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: E = None
        self.s: A = None
        self.x: H = None
        self.v: B = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: J = None
        self.w: C = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.p: E = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: J = None
        self.z: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: J = None
        self.w: D = None
        self.s: A = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: E = None
        self.s: A = None
        self.x: H = None
        self.v: B = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: J = None
        self.w: C = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.p: E = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: J = None
        self.z: H = None
        self.txt = txt

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

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

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