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

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

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

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

e = A("e")
i = B("i")
c = C("c")
j = D("j")
l = E("l")
f = C("f")
d = B("d")
a = D("a")
n = C("n")
m = A("m")

e.v = l
e.w = l
e.q = c
e.r = m
i.p = d
i.y = f
c.y = f
c.q = l
c.t = n
j.y = i
j.o = d
l.w = d
f.y = n
f.q = l
f.t = c
d.p = i
d.y = c
a.y = d
a.o = d
n.y = c
n.q = l
n.t = f
m.v = l
m.w = l
m.q = c
m.r = e
assert f.t.q.w.y.y.t.y.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: C = None
        self.w: E = None
        self.r: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

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

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

e = A("e")
i = B("i")
c = C("c")
j = D("j")
l = E("l")
f = C("f")
d = B("d")
a = D("a")
n = C("n")
m = A("m")

e.v = l
e.w = l
e.q = c
e.r = m
i.p = d
i.y = f
c.y = f
c.q = l
c.t = n
j.y = i
j.o = d
l.w = d
f.y = n
f.q = l
f.t = c
d.p = i
d.y = c
a.y = d
a.o = d
n.y = c
n.q = l
n.t = f
m.v = l
m.w = l
m.q = c
m.r = e
assert f.t.q.w.y.y.t.y.q.w.txt == "d"