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

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

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

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

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

n = A("n")
e = B("e")
l = C("l")
k = D("k")
j = E("j")
g = D("g")
h = B("h")

n.t = l
n.w = l
e.q = k
e.r = n
e.y = j
l.v = j
l.x = j
l.z = n
k.z = n
j.y = l
j.s = h
j.z = n
j.o = n
j.x = n
g.z = n
h.q = k
h.r = n
h.y = j
assert e.y.x.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.txt = txt

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

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

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

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

n = A("n")
e = B("e")
l = C("l")
k = D("k")
j = E("j")
g = D("g")
h = B("h")

n.t = l
n.w = l
e.q = k
e.r = n
e.y = j
l.v = j
l.x = j
l.z = n
k.z = n
j.y = l
j.s = h
j.z = n
j.o = n
j.x = n
g.z = n
h.q = k
h.r = n
h.y = j
assert e.y.x.t.z.txt == "n"