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

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

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

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

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

g = A("g")
k = B("k")
j = C("j")
m = D("m")
b = E("b")
l = C("l")
i = A("i")
f = B("f")

g.o = f
g.v = m
g.w = b
g.r = b
k.v = g
k.p = j
k.w = j
k.o = j
j.s = b
j.p = i
m.p = g
m.y = b
m.s = f
b.w = g
b.v = m
b.t = f
l.s = b
l.p = g
i.o = k
i.v = m
i.w = b
i.r = b
f.v = i
f.p = j
f.w = j
f.o = j
assert f.w.s.v.y.v.s.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: D = None
        self.w: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

g = A("g")
k = B("k")
j = C("j")
m = D("m")
b = E("b")
l = C("l")
i = A("i")
f = B("f")

g.o = f
g.v = m
g.w = b
g.r = b
k.v = g
k.p = j
k.w = j
k.o = j
j.s = b
j.p = i
m.p = g
m.y = b
m.s = f
b.w = g
b.v = m
b.t = f
l.s = b
l.p = g
i.o = k
i.v = m
i.w = b
i.r = b
f.v = i
f.p = j
f.w = j
f.o = j
assert f.w.s.v.y.v.s.v.o.txt == "k"