class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: E = None
        self.q: C = None
        self.t: C = None
        self.r: C = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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