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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.y: D = None
        self.t: C = None
        self.r: E = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
a = C("a")
c = D("c")
f = E("f")

e.o = c
e.y = c
e.x = c
e.w = i
e.v = f
i.x = e
i.s = e
i.y = c
i.t = a
i.r = f
a.u = f
a.s = i
c.q = a
c.o = e
c.s = e
c.x = f
f.o = e
assert f.o.v.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.y: D = None
        self.v: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.y: D = None
        self.t: C = None
        self.r: E = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
a = C("a")
c = D("c")
f = E("f")

e.o = c
e.y = c
e.x = c
e.w = i
e.v = f
i.x = e
i.s = e
i.y = c
i.t = a
i.r = f
a.u = f
a.s = i
c.q = a
c.o = e
c.s = e
c.x = f
f.o = e
assert f.o.v.o.y.txt == "c"