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

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

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

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

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

a = A("a")
n = B("n")
f = C("f")
m = D("m")
c = E("c")
l = B("l")

a.o = c
n.w = f
n.u = m
n.x = l
f.u = m
f.s = c
f.x = c
f.p = a
m.v = f
m.y = c
m.p = l
c.y = a
c.o = f
c.w = f
c.u = f
l.w = f
l.u = m
l.x = n
assert a.o.y.o.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

a = A("a")
n = B("n")
f = C("f")
m = D("m")
c = E("c")
l = B("l")

a.o = c
n.w = f
n.u = m
n.x = l
f.u = m
f.s = c
f.x = c
f.p = a
m.v = f
m.y = c
m.p = l
c.y = a
c.o = f
c.w = f
c.u = f
l.w = f
l.u = m
l.x = n
assert a.o.y.o.y.o.txt == "c"