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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

f = A("f")
a = B("a")
l = C("l")
i = D("i")
k = E("k")
j = A("j")
h = E("h")
e = A("e")
d = B("d")

f.r = i
a.w = h
a.r = d
a.q = i
a.y = i
a.s = e
l.u = d
l.r = d
l.t = d
l.x = i
i.w = l
k.o = f
k.p = f
k.z = f
k.w = l
j.r = i
h.o = j
h.z = j
h.p = f
h.w = l
e.r = i
d.w = k
d.r = a
d.q = i
d.y = i
d.s = j
assert a.r.y.w.x.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

f = A("f")
a = B("a")
l = C("l")
i = D("i")
k = E("k")
j = A("j")
h = E("h")
e = A("e")
d = B("d")

f.r = i
a.w = h
a.r = d
a.q = i
a.y = i
a.s = e
l.u = d
l.r = d
l.t = d
l.x = i
i.w = l
k.o = f
k.p = f
k.z = f
k.w = l
j.r = i
h.o = j
h.z = j
h.p = f
h.w = l
e.r = i
d.w = k
d.r = a
d.q = i
d.y = i
d.s = j
assert a.r.y.w.x.w.x.txt == "i"