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

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

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

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

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

k = A("k")
i = B("i")
f = C("f")
g = D("g")
h = E("h")
l = B("l")
c = C("c")
e = D("e")

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

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

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

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

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

k = A("k")
i = B("i")
f = C("f")
g = D("g")
h = E("h")
l = B("l")
c = C("c")
e = D("e")

k.o = h
k.p = h
k.w = h
i.s = f
i.y = k
f.v = e
f.q = e
g.o = i
h.r = l
h.q = f
h.p = i
h.t = e
l.s = c
l.y = k
c.v = e
c.q = e
e.o = i
assert g.o.y.p.p.s.v.o.s.txt == "f"