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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

a.u = i
a.s = i
a.x = e
a.w = d
a.v = d
a.p = m
n.t = a
n.z = a
n.v = a
n.u = d
i.u = j
m.v = n
j.t = n
j.w = e
j.q = m
l.p = m
c.u = j
f.p = m
d.u = c
d.s = c
d.x = j
d.w = a
d.v = a
d.p = m
e.t = n
e.w = j
e.q = m
assert n.u.x.t.v.p.v.u.w.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: C = None
        self.x: E = None
        self.w: A = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

a.u = i
a.s = i
a.x = e
a.w = d
a.v = d
a.p = m
n.t = a
n.z = a
n.v = a
n.u = d
i.u = j
m.v = n
j.t = n
j.w = e
j.q = m
l.p = m
c.u = j
f.p = m
d.u = c
d.s = c
d.x = j
d.w = a
d.v = a
d.p = m
e.t = n
e.w = j
e.q = m
assert n.u.x.t.v.p.v.u.w.s.u.txt == "j"