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

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

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

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

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

i = A("i")
a = B("a")
b = C("b")
j = D("j")
e = E("e")

i.v = e
i.r = j
i.t = b
i.p = b
a.w = b
b.x = i
b.v = e
j.y = i
e.o = j
assert i.r.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.t: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

i = A("i")
a = B("a")
b = C("b")
j = D("j")
e = E("e")

i.v = e
i.r = j
i.t = b
i.p = b
a.w = b
b.x = i
b.v = e
j.y = i
e.o = j
assert i.r.y.v.txt == "e"