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

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

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

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

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

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

n = A("n")
e = B("e")
f = C("f")
m = D("m")
h = E("h")
k = F("k")
c = A("c")
i = C("i")
b = B("b")
l = D("l")

n.w = h
e.t = i
e.r = h
e.w = h
e.s = b
e.v = b
e.p = n
f.x = i
f.w = m
f.y = e
m.x = c
h.v = k
h.q = l
k.y = m
c.w = h
i.x = f
i.w = m
i.y = b
b.t = f
b.r = h
b.w = h
b.s = e
b.v = e
b.p = n
l.x = c
assert e.w.q.x.w.q.x.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

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

n = A("n")
e = B("e")
f = C("f")
m = D("m")
h = E("h")
k = F("k")
c = A("c")
i = C("i")
b = B("b")
l = D("l")

n.w = h
e.t = i
e.r = h
e.w = h
e.s = b
e.v = b
e.p = n
f.x = i
f.w = m
f.y = e
m.x = c
h.v = k
h.q = l
k.y = m
c.w = h
i.x = f
i.w = m
i.y = b
b.t = f
b.r = h
b.w = h
b.s = e
b.v = e
b.p = n
l.x = c
assert e.w.q.x.w.q.x.w.v.txt == "k"