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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: B = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: I = None
        self.s: G = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: D = None
        self.y: C = None
        self.t: A = None
        self.txt = txt

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

h.t = g
h.p = a
h.x = a
h.v = l
h.z = b
h.o = b
h.r = m
h.u = i
a.w = d
a.s = d
a.v = e
a.r = i
a.p = f
a.o = f
a.y = g
a.x = g
a.u = l
a.z = b
g.x = e
g.r = a
g.s = h
l.t = g
l.o = g
l.u = i
l.s = d
m.r = h
m.o = h
e.o = g
d.q = i
d.p = i
d.t = g
d.v = e
d.r = a
d.o = a
d.x = l
d.y = m
d.w = m
b.p = d
b.x = d
b.r = l
b.u = g
i.r = h
i.x = m
f.o = m
f.s = l
f.y = g
f.t = h
assert l.s.t.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.v: D = None
        self.z: H = None
        self.r: E = None
        self.o: H = None
        self.x: B = None
        self.u: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: B = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: I = None
        self.s: G = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: D = None
        self.y: C = None
        self.t: A = None
        self.txt = txt

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

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