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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.q: A = None
        self.r: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: E = None
        self.r: E = None
        self.s: D = None
        self.txt = txt

h = A("h")
i = B("i")
m = C("m")
g = D("g")
f = E("f")
e = F("e")

h.v = e
h.t = g
h.x = i
i.w = m
m.p = h
m.o = h
m.q = h
m.r = i
g.y = f
g.s = i
f.o = i
f.y = m
f.v = e
f.z = e
f.w = e
f.u = h
e.w = m
e.q = f
e.r = f
e.s = g
assert i.w.o.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.q: A = None
        self.r: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: E = None
        self.r: E = None
        self.s: D = None
        self.txt = txt

h = A("h")
i = B("i")
m = C("m")
g = D("g")
f = E("f")
e = F("e")

h.v = e
h.t = g
h.x = i
i.w = m
m.p = h
m.o = h
m.q = h
m.r = i
g.y = f
g.s = i
f.o = i
f.y = m
f.v = e
f.z = e
f.w = e
f.u = h
e.w = m
e.q = f
e.r = f
e.s = g
assert i.w.o.x.w.txt == "m"