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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: E = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

a = A("a")
e = B("e")
h = C("h")
c = D("c")
l = E("l")
f = F("f")
j = G("j")
b = H("b")

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: E = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

a = A("a")
e = B("e")
h = C("h")
c = D("c")
l = E("l")
f = F("f")
j = G("j")
b = H("b")

a.o = c
a.v = b
e.p = a
e.z = l
e.q = c
h.w = e
h.t = j
h.q = l
c.r = b
c.w = b
c.x = j
c.s = e
c.q = f
l.v = c
f.q = l
f.y = j
j.z = h
j.y = h
j.q = b
j.o = f
j.t = l
j.r = l
b.t = l
b.z = e
b.x = e
b.y = e
b.s = e
b.u = f
b.w = a
assert c.q.q.v.r.w.txt == "a"