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

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

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

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

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

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

h = A("h")
j = B("j")
e = C("e")
m = D("m")
c = E("c")
k = F("k")
a = C("a")
d = A("d")
n = B("n")

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

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

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

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

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

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

h = A("h")
j = B("j")
e = C("e")
m = D("m")
c = E("c")
k = F("k")
a = C("a")
d = A("d")
n = B("n")

h.t = c
h.w = k
h.u = k
h.s = d
j.u = m
j.w = n
j.y = h
e.z = n
e.o = k
m.q = j
c.s = m
c.t = h
c.u = h
c.r = k
c.w = k
c.q = a
k.w = c
a.z = j
a.o = k
d.t = c
d.w = k
d.u = k
d.s = h
n.u = m
n.w = j
n.y = h
assert h.w.w.q.o.w.q.o.w.txt == "c"