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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: B = None
        self.o: C = None
        self.t: C = None
        self.txt = txt

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

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

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

g.x = i
g.r = i
g.q = a
g.s = j
g.y = j
j.u = k
k.y = g
k.u = j
k.o = i
k.t = i
e.w = g
a.s = g
b.s = g
i.y = g
i.u = j
i.o = k
i.t = k
assert i.o.u.u.u.u.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.r: C = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: B = None
        self.o: C = None
        self.t: C = None
        self.txt = txt

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

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

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

g.x = i
g.r = i
g.q = a
g.s = j
g.y = j
j.u = k
k.y = g
k.u = j
k.o = i
k.t = i
e.w = g
a.s = g
b.s = g
i.y = g
i.u = j
i.o = k
i.t = k
assert i.o.u.u.u.u.y.x.txt == "i"