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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.s: A = None
        self.txt = txt

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

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

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

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

i.w = j
i.v = k
i.x = f
i.q = b
i.s = g
b.r = g
b.o = g
b.s = i
l.y = j
f.q = d
a.z = l
a.s = b
a.r = i
a.q = i
d.q = j
j.q = d
g.r = b
g.o = b
g.s = i
k.z = l
k.s = g
k.r = i
k.q = i
assert f.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.x: D = None
        self.q: B = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.s: A = None
        self.txt = txt

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

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

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

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

i.w = j
i.v = k
i.x = f
i.q = b
i.s = g
b.r = g
b.o = g
b.s = i
l.y = j
f.q = d
a.z = l
a.s = b
a.r = i
a.q = i
d.q = j
j.q = d
g.r = b
g.o = b
g.s = i
k.z = l
k.s = g
k.r = i
k.q = i
assert f.q.q.q.q.txt == "j"