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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: C = None
        self.x: C = None
        self.txt = txt

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

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

j.o = g
j.y = g
j.r = g
j.s = d
l.x = i
l.p = k
f.x = j
g.w = l
g.r = f
g.x = f
d.p = i
d.y = i
k.o = g
k.y = g
k.r = g
k.s = d
i.x = l
i.p = j
assert i.p.r.x.x.s.p.p.txt == "j"