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

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

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

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

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

c = A("c")
g = B("g")
b = C("b")
l = D("l")
k = E("k")
j = C("j")
h = A("h")

c.o = j
c.q = l
g.s = l
g.o = l
g.x = j
b.p = g
b.z = g
b.w = k
l.t = b
l.x = b
l.q = g
k.z = g
k.t = c
j.p = g
j.z = g
j.w = k
h.o = b
h.q = l
assert h.o.w.z.x.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

c = A("c")
g = B("g")
b = C("b")
l = D("l")
k = E("k")
j = C("j")
h = A("h")

c.o = j
c.q = l
g.s = l
g.o = l
g.x = j
b.p = g
b.z = g
b.w = k
l.t = b
l.x = b
l.q = g
k.z = g
k.t = c
j.p = g
j.z = g
j.w = k
h.o = b
h.q = l
assert h.o.w.z.x.z.s.txt == "l"