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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

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

c = A("c")
j = B("j")
h = C("h")
n = D("n")
k = E("k")
a = F("a")

c.s = k
c.u = k
c.o = a
c.v = j
j.v = k
j.y = n
h.t = j
h.p = n
n.v = k
n.x = a
k.x = h
k.z = h
k.o = n
k.v = c
a.w = h
a.u = k
assert n.x.u.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: F = None
        self.v: B = None
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

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

c = A("c")
j = B("j")
h = C("h")
n = D("n")
k = E("k")
a = F("a")

c.s = k
c.u = k
c.o = a
c.v = j
j.v = k
j.y = n
h.t = j
h.p = n
n.v = k
n.x = a
k.x = h
k.z = h
k.o = n
k.v = c
a.w = h
a.u = k
assert n.x.u.o.x.txt == "a"