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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: C = None
        self.z: F = None
        self.y: A = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.x: F = None
        self.r: A = None
        self.t: C = None
        self.txt = txt

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

a = A("a")
l = B("l")
j = C("j")
g = D("g")
c = E("c")
n = F("n")

a.u = n
a.o = n
a.v = j
a.x = l
l.v = n
l.z = n
l.r = j
l.y = a
l.s = c
j.o = g
g.z = n
g.t = n
g.o = n
g.w = j
g.y = l
g.v = a
c.u = j
c.t = j
c.q = l
c.x = n
c.r = a
n.t = j
n.x = c
n.w = l
assert n.x.q.s.u.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: C = None
        self.x: B = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: C = None
        self.z: F = None
        self.y: A = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.x: F = None
        self.r: A = None
        self.t: C = None
        self.txt = txt

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

a = A("a")
l = B("l")
j = C("j")
g = D("g")
c = E("c")
n = F("n")

a.u = n
a.o = n
a.v = j
a.x = l
l.v = n
l.z = n
l.r = j
l.y = a
l.s = c
j.o = g
g.z = n
g.t = n
g.o = n
g.w = j
g.y = l
g.v = a
c.u = j
c.t = j
c.q = l
c.x = n
c.r = a
n.t = j
n.x = c
n.w = l
assert n.x.q.s.u.o.w.txt == "j"