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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
b = C("b")
i = D("i")
k = E("k")

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
b = C("b")
i = D("i")
k = E("k")

e.y = i
e.t = b
e.r = k
h.x = k
h.t = k
h.q = i
h.r = i
b.u = k
b.p = h
b.z = i
i.p = h
i.w = h
i.o = e
k.z = h
k.t = b
k.v = e
assert b.p.t.v.txt == "e"