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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: B = None
        self.r: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: B = None
        self.r: D = None
        self.o: B = None
        self.txt = txt

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

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