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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.o: C = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

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

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

f.v = e
f.t = m
d.s = e
i.u = b
i.o = b
i.v = j
i.y = d
i.q = d
m.y = e
e.o = d
n.v = e
n.t = m
j.o = a
a.s = j
b.u = i
b.o = i
b.v = e
b.y = a
b.q = d
assert d.s.o.s.o.s.o.s.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.o: C = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

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

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

f.v = e
f.t = m
d.s = e
i.u = b
i.o = b
i.v = j
i.y = d
i.q = d
m.y = e
e.o = d
n.v = e
n.t = m
j.o = a
a.s = j
b.u = i
b.o = i
b.v = e
b.y = a
b.q = d
assert d.s.o.s.o.s.o.s.o.s.txt == "e"