class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: D = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: D = None
        self.u: G = None
        self.r: A = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: H = None
        self.r: G = None
        self.z: G = None
        self.q: G = None
        self.u: G = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.q: B = None
        self.s: F = None
        self.v: E = None
        self.txt = txt

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

b.q = a
b.o = f
b.v = e
b.u = n
c.v = k
c.y = n
c.s = l
e.s = j
e.q = f
e.u = m
e.r = b
e.p = n
f.z = a
f.p = e
f.w = e
f.r = k
f.s = b
f.v = m
f.o = n
a.q = n
a.v = f
n.o = k
n.w = j
n.r = m
n.z = m
n.q = m
n.u = m
n.p = m
m.p = a
m.q = f
m.y = e
m.o = b
m.z = b
j.x = k
j.q = k
j.o = f
j.s = n
j.v = a
l.q = a
l.o = f
l.v = e
l.u = n
k.v = c
k.y = n
k.s = l
assert l.v.r.u.q.y.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: D = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: D = None
        self.u: G = None
        self.r: A = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: H = None
        self.r: G = None
        self.z: G = None
        self.q: G = None
        self.u: G = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.q: B = None
        self.s: F = None
        self.v: E = None
        self.txt = txt

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

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