class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: G = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.t: F = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: H = None
        self.p: A = None
        self.w: D = None
        self.o: B = None
        self.s: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: B = None
        self.p: E = None
        self.u: E = None
        self.w: B = None
        self.t: E = None
        self.q: B = None
        self.txt = txt

n = A("n")
j = B("j")
f = C("f")
c = D("c")
l = E("l")
h = F("h")
e = G("e")
g = H("g")
d = D("d")

n.q = f
n.r = e
n.o = e
j.z = l
j.w = h
f.w = j
f.x = n
c.r = n
c.u = h
c.t = h
c.q = d
l.q = e
l.x = g
l.p = n
l.w = d
l.o = j
l.s = c
h.s = g
h.z = g
e.p = l
e.s = l
e.u = g
e.q = h
e.v = h
e.z = h
e.w = n
g.r = n
g.o = j
g.w = j
g.q = j
g.p = l
g.u = l
g.t = l
d.r = n
d.u = h
d.t = h
d.q = c
assert l.p.q.w.z.o.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: G = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.t: F = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: H = None
        self.p: A = None
        self.w: D = None
        self.o: B = None
        self.s: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: B = None
        self.p: E = None
        self.u: E = None
        self.w: B = None
        self.t: E = None
        self.q: B = None
        self.txt = txt

n = A("n")
j = B("j")
f = C("f")
c = D("c")
l = E("l")
h = F("h")
e = G("e")
g = H("g")
d = D("d")

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