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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: F = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: C = None
        self.q: C = None
        self.o: I = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.z: C = None
        self.r: D = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: E = None
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: F = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: C = None
        self.q: C = None
        self.o: I = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.z: C = None
        self.r: D = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: E = None
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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