class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: H = None
        self.v: F = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: E = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: H = None
        self.o: C = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.x: E = None
        self.z: G = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

a = A("a")
m = B("m")
c = C("c")
k = D("k")
n = E("n")
l = F("l")
i = G("i")
b = H("b")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: H = None
        self.v: F = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: E = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: H = None
        self.o: C = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.x: E = None
        self.z: G = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

a = A("a")
m = B("m")
c = C("c")
k = D("k")
n = E("n")
l = F("l")
i = G("i")
b = H("b")

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