class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: C = None
        self.z: A = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: G = None
        self.w: G = None
        self.r: H = None
        self.x: I = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: E = None
        self.o: F = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.t: I = None
        self.s: D = None
        self.u: F = None
        self.r: A = None
        self.v: F = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: J = None
        self.y: F = None
        self.r: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: F = None
        self.q: D = None
        self.x: A = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: C = None
        self.z: A = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: G = None
        self.w: G = None
        self.r: H = None
        self.x: I = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: E = None
        self.o: F = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.t: I = None
        self.s: D = None
        self.u: F = None
        self.r: A = None
        self.v: F = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: J = None
        self.y: F = None
        self.r: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: F = None
        self.q: D = None
        self.x: A = None
        self.w: B = None
        self.txt = txt

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

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