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

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

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

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

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

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

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

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

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

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

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

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

f.o = j
f.w = g
e.v = f
e.s = f
e.z = b
e.t = n
l.v = b
b.q = f
b.t = l
b.y = l
g.q = n
n.v = f
n.s = f
n.z = b
n.t = e
j.v = b
assert n.s.w.q.txt == "n"