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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.w: C = None
        self.txt = txt

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

d.w = e
n.q = f
n.o = k
n.t = g
n.s = g
n.v = j
i.v = f
i.o = h
i.y = c
i.u = c
i.x = j
i.s = j
j.z = f
j.w = g
j.x = d
f.s = j
f.u = e
f.w = e
f.z = k
h.y = g
h.s = j
h.w = c
k.y = g
k.s = j
k.w = i
g.q = f
g.o = h
g.t = n
g.s = n
g.v = j
c.v = f
c.o = h
c.y = i
c.u = i
c.x = j
c.s = j
e.w = d
assert j.w.s.q.w.w.w.w.w.w.txt == "d"