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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: H = None
        self.o: C = None
        self.w: I = None
        self.y: F = None
        self.u: G = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: B = None
        self.o: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.q: B = None
        self.p: B = None
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: G = None
        self.t: I = None
        self.x: A = None
        self.p: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: H = None
        self.o: C = None
        self.w: I = None
        self.y: F = None
        self.u: G = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: B = None
        self.o: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.q: B = None
        self.p: B = None
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: G = None
        self.t: I = None
        self.x: A = None
        self.p: I = None
        self.txt = txt

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

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