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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: F = None
        self.z: A = None
        self.v: G = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: F = None
        self.z: A = None
        self.v: G = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: F = None
        self.txt = txt

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

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