class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.r: F = None
        self.s: B = None
        self.x: C = None
        self.z: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.r: F = None
        self.s: B = None
        self.x: C = None
        self.z: H = None
        self.txt = txt

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

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

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