class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: F = None
        self.w: H = None
        self.v: D = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: H = None
        self.u: A = None
        self.txt = txt

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

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

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

j = A("j")
i = B("i")
f = C("f")
c = D("c")
d = E("d")
b = F("b")
e = G("e")
n = H("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: H = None
        self.u: A = None
        self.txt = txt

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

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

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

j = A("j")
i = B("i")
f = C("f")
c = D("c")
d = E("d")
b = F("b")
e = G("e")
n = H("n")

j.u = c
j.v = c
j.s = c
j.z = b
j.w = n
i.s = f
f.o = n
f.u = d
f.p = c
f.z = e
f.x = e
f.v = i
c.o = d
c.t = i
c.r = j
d.w = n
d.r = n
d.u = j
b.x = j
b.r = i
b.q = i
b.z = n
b.o = n
e.x = n
e.q = f
n.x = e
n.o = b
n.p = j
assert b.q.s.z.x.p.txt == "j"