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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: D = None
        self.y: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: D = None
        self.y: B = None
        self.u: C = None
        self.txt = txt

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

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