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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.v: D = None
        self.w: F = None
        self.txt = txt

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

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

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

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

n = A("n")
e = B("e")
i = C("i")
a = D("a")
j = E("j")
c = F("c")

n.x = e
n.v = a
e.t = a
e.v = a
e.o = i
e.w = c
i.u = a
i.v = e
i.o = c
a.w = e
a.r = j
a.u = j
j.o = c
c.u = e
c.v = a
c.r = j
assert a.w.o.u.w.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.v: D = None
        self.w: F = None
        self.txt = txt

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

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

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

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

n = A("n")
e = B("e")
i = C("i")
a = D("a")
j = E("j")
c = F("c")

n.x = e
n.v = a
e.t = a
e.v = a
e.o = i
e.w = c
i.u = a
i.v = e
i.o = c
a.w = e
a.r = j
a.u = j
j.o = c
c.u = e
c.v = a
c.r = j
assert a.w.o.u.w.o.v.txt == "e"