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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

m = A("m")
g = B("g")
i = C("i")
b = D("b")
h = E("h")
l = F("l")
c = F("c")

m.v = i
m.p = h
m.q = h
g.v = i
g.x = i
g.y = i
i.u = c
i.z = m
i.t = m
i.s = h
i.q = b
i.x = g
b.p = i
b.r = h
h.z = g
h.o = b
h.q = b
h.u = m
l.t = m
l.z = c
c.t = m
c.z = l
assert c.z.t.v.z.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

m = A("m")
g = B("g")
i = C("i")
b = D("b")
h = E("h")
l = F("l")
c = F("c")

m.v = i
m.p = h
m.q = h
g.v = i
g.x = i
g.y = i
i.u = c
i.z = m
i.t = m
i.s = h
i.q = b
i.x = g
b.p = i
b.r = h
h.z = g
h.o = b
h.q = b
h.u = m
l.t = m
l.z = c
c.t = m
c.z = l
assert c.z.t.v.z.q.u.txt == "m"