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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: G = None
        self.o: I = None
        self.y: F = None
        self.u: H = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: E = None
        self.v: G = None
        self.y: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: G = None
        self.u: B = None
        self.t: G = None
        self.txt = txt

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

j = A("j")
m = B("m")
h = C("h")
d = D("d")
f = E("f")
c = F("c")
a = G("a")
i = H("i")
g = I("g")
l = J("l")

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: G = None
        self.o: I = None
        self.y: F = None
        self.u: H = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: E = None
        self.v: G = None
        self.y: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: G = None
        self.u: B = None
        self.t: G = None
        self.txt = txt

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

j = A("j")
m = B("m")
h = C("h")
d = D("d")
f = E("f")
c = F("c")
a = G("a")
i = H("i")
g = I("g")
l = J("l")

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