class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.p: F = None
        self.x: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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