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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: A = None
        self.v: B = None
        self.w: D = None
        self.s: D = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: D = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: F = None
        self.q: D = None
        self.z: B = None
        self.x: E = None
        self.r: A = None
        self.p: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: A = None
        self.v: B = None
        self.w: D = None
        self.s: D = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: D = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: F = None
        self.q: D = None
        self.z: B = None
        self.x: E = None
        self.r: A = None
        self.p: E = None
        self.txt = txt

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

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