class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: B = None
        self.v: G = None
        self.p: G = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: G = None
        self.y: B = None
        self.o: C = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: F = None
        self.v: H = None
        self.s: I = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.t: C = None
        self.u: I = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.p: E = None
        self.o: C = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: G = None
        self.y: B = None
        self.o: C = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: F = None
        self.v: H = None
        self.s: I = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.t: C = None
        self.u: I = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.p: E = None
        self.o: C = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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