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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.y: B = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
a = C("a")
g = D("g")
i = E("i")
b = B("b")
n = D("n")

f.t = i
j.u = i
j.z = a
j.t = b
a.q = i
a.o = i
a.y = j
g.z = n
g.p = j
i.r = b
i.o = b
i.v = g
i.w = f
i.t = a
b.u = i
b.z = a
b.t = j
n.z = g
n.p = j
assert a.o.t.y.z.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.y: B = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
a = C("a")
g = D("g")
i = E("i")
b = B("b")
n = D("n")

f.t = i
j.u = i
j.z = a
j.t = b
a.q = i
a.o = i
a.y = j
g.z = n
g.p = j
i.r = b
i.o = b
i.v = g
i.w = f
i.t = a
b.u = i
b.z = a
b.t = j
n.z = g
n.p = j
assert a.o.t.y.z.o.w.txt == "f"