class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.o: H = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: C = None
        self.s: A = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: D = None
        self.v: A = None
        self.x: E = None
        self.q: D = None
        self.z: A = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: F = None
        self.s: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: C = None
        self.s: A = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: D = None
        self.v: A = None
        self.x: E = None
        self.q: D = None
        self.z: A = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: F = None
        self.s: G = None
        self.txt = txt

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

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