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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: A = None
        self.o: D = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: F = None
        self.z: A = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: A = None
        self.o: D = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: F = None
        self.z: A = None
        self.q: D = None
        self.txt = txt

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

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