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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: E = None
        self.u: D = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.x: B = None
        self.y: C = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

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

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

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

e.p = k
e.r = f
e.t = n
h.w = k
h.y = f
h.s = f
h.v = m
h.t = e
f.p = e
f.y = l
f.u = n
f.t = n
f.r = m
n.v = m
n.y = m
n.r = h
n.x = k
n.o = e
n.t = i
l.v = e
l.o = f
i.s = l
m.p = e
m.y = l
m.u = n
m.t = n
m.r = f
k.w = h
k.y = m
k.s = m
k.v = f
k.t = e
assert e.p.s.y.v.p.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: C = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: E = None
        self.u: D = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.x: B = None
        self.y: C = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

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

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

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

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