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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: E = None
        self.u: C = None
        self.z: E = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: B = None
        self.txt = txt

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

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

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

g = A("g")
a = B("a")
b = C("b")
h = D("h")
n = E("n")
j = F("j")

g.v = h
g.y = h
g.o = n
a.t = h
a.x = n
a.z = n
a.u = b
a.s = b
a.o = j
b.y = g
b.z = a
h.z = g
h.q = g
h.r = a
h.y = j
h.w = b
n.s = a
n.r = a
n.u = b
n.v = j
j.w = a
assert n.u.z.o.w.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: D = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: E = None
        self.u: C = None
        self.z: E = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: B = None
        self.txt = txt

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

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

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

g = A("g")
a = B("a")
b = C("b")
h = D("h")
n = E("n")
j = F("j")

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