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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.r: D = None
        self.o: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: E = None
        self.s: B = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.r: D = None
        self.o: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: E = None
        self.s: B = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

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

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

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