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

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

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

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

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

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

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

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

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

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

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

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

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

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

m.v = h
m.q = i
m.x = c
m.s = c
m.z = e
n.r = g
n.p = i
n.x = i
h.q = e
h.v = i
e.o = h
e.x = h
e.s = m
c.o = h
c.v = e
i.r = c
i.q = g
g.r = c
g.q = i
assert m.v.q.s.v.v.txt == "i"