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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.x: D = None
        self.z: A = None
        self.y: E = None
        self.txt = txt

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

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

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

k.y = i
k.q = n
k.o = n
k.u = n
k.v = n
h.q = f
h.p = i
i.t = n
i.y = n
i.o = k
i.z = k
i.x = f
b.q = l
b.w = f
b.o = f
n.u = k
n.x = b
n.s = h
n.z = h
n.v = i
l.q = f
l.p = i
f.q = l
f.w = b
f.o = b
g.q = f
g.p = i
assert n.u.y.o.y.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.o: E = None
        self.u: E = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.x: D = None
        self.z: A = None
        self.y: E = None
        self.txt = txt

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

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

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

k.y = i
k.q = n
k.o = n
k.u = n
k.v = n
h.q = f
h.p = i
i.t = n
i.y = n
i.o = k
i.z = k
i.x = f
b.q = l
b.w = f
b.o = f
n.u = k
n.x = b
n.s = h
n.z = h
n.v = i
l.q = f
l.p = i
f.q = l
f.w = b
f.o = b
g.q = f
g.p = i
assert n.u.y.o.y.x.q.txt == "l"