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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: G = None
        self.w: C = None
        self.o: D = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.p: B = None
        self.u: A = None
        self.x: C = None
        self.r: G = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: H = None
        self.t: F = None
        self.r: F = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
h = C("h")
i = D("i")
m = E("m")
k = F("k")
a = G("a")
f = H("f")
b = E("b")

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: G = None
        self.w: C = None
        self.o: D = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.p: B = None
        self.u: A = None
        self.x: C = None
        self.r: G = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: H = None
        self.t: F = None
        self.r: F = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
h = C("h")
i = D("i")
m = E("m")
k = F("k")
a = G("a")
f = H("f")
b = E("b")

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