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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

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

d.y = e
e.o = l
e.z = f
m.w = d
m.v = e
m.y = a
m.r = i
n.t = i
n.q = i
k.s = e
k.v = i
k.q = d
l.w = d
l.v = a
l.y = e
l.r = i
a.o = l
a.z = f
i.s = e
i.v = k
i.q = d
f.t = k
f.q = i
g.w = d
g.v = e
g.y = a
g.r = k
assert n.q.s.o.r.s.o.v.o.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

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

d.y = e
e.o = l
e.z = f
m.w = d
m.v = e
m.y = a
m.r = i
n.t = i
n.q = i
k.s = e
k.v = i
k.q = d
l.w = d
l.v = a
l.y = e
l.r = i
a.o = l
a.z = f
i.s = e
i.v = k
i.q = d
f.t = k
f.q = i
g.w = d
g.v = e
g.y = a
g.r = k
assert n.q.s.o.r.s.o.v.o.y.z.txt == "f"