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

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

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

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

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

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

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

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

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

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

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

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

b.q = k
b.o = a
g.w = i
g.r = i
g.o = l
g.u = a
k.s = b
l.o = j
a.u = k
a.q = f
a.x = l
a.y = b
f.u = j
f.q = a
f.x = h
f.y = n
i.w = g
i.r = g
i.o = h
i.u = f
h.o = j
j.s = b
n.q = j
n.o = f
assert i.o.o.s.q.s.o.x.txt == "l"