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

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

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

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

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

k = A("k")
l = B("l")
b = C("b")
i = D("i")
d = E("d")
c = B("c")
n = A("n")
e = D("e")
g = B("g")
f = A("f")

k.y = n
k.x = f
k.q = g
k.p = i
l.u = n
l.y = n
l.w = g
l.o = b
b.x = d
b.v = d
b.p = e
i.q = b
i.o = b
i.x = n
i.y = l
d.z = l
d.q = i
c.u = n
c.y = n
c.w = g
c.o = b
n.y = f
n.x = f
n.q = g
n.p = i
e.q = b
e.o = b
e.x = f
e.y = g
g.u = f
g.y = f
g.w = l
g.o = b
f.y = k
f.x = n
f.q = l
f.p = i
assert i.y.y.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.q: B = None
        self.p: D = None
        self.txt = txt

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

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

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

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

k = A("k")
l = B("l")
b = C("b")
i = D("i")
d = E("d")
c = B("c")
n = A("n")
e = D("e")
g = B("g")
f = A("f")

k.y = n
k.x = f
k.q = g
k.p = i
l.u = n
l.y = n
l.w = g
l.o = b
b.x = d
b.v = d
b.p = e
i.q = b
i.o = b
i.x = n
i.y = l
d.z = l
d.q = i
c.u = n
c.y = n
c.w = g
c.o = b
n.y = f
n.x = f
n.q = g
n.p = i
e.q = b
e.o = b
e.x = f
e.y = g
g.u = f
g.y = f
g.w = l
g.o = b
f.y = k
f.x = n
f.q = l
f.p = i
assert i.y.y.q.w.txt == "l"