class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: E = None
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: F = None
        self.p: E = None
        self.v: B = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

n.w = c
n.y = i
n.v = i
n.u = a
d.v = a
d.s = i
a.s = d
a.v = d
a.x = c
a.p = i
a.w = j
a.y = j
j.t = d
j.x = a
j.y = i
i.r = a
c.v = n
assert c.v.u.v.v.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: E = None
        self.u: C = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: F = None
        self.p: E = None
        self.v: B = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

n.w = c
n.y = i
n.v = i
n.u = a
d.v = a
d.s = i
a.s = d
a.v = d
a.x = c
a.p = i
a.w = j
a.y = j
j.t = d
j.x = a
j.y = i
i.r = a
c.v = n
assert c.v.u.v.v.y.t.txt == "d"