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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: B = None
        self.v: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: B = None
        self.v: E = None
        self.x: A = None
        self.txt = txt

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

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