class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: E = None
        self.t: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

f = A("f")
g = B("g")
n = C("n")
j = D("j")
b = E("b")
h = B("h")

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

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

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

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

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

f = A("f")
g = B("g")
n = C("n")
j = D("j")
b = E("b")
h = B("h")

f.s = n
f.q = b
f.v = b
f.t = g
g.o = b
n.y = g
n.z = g
j.w = b
j.r = n
b.y = f
b.v = f
b.o = j
b.x = n
h.o = b
assert h.o.o.r.z.o.x.txt == "n"